<template>
    <div class="liveBox">
        <div class="title">
            <h1>相关直播推荐</h1>
            <p>你已经被我一个人包围</p>
        </div>
        <div class="infoBox">
            <div class="info" v-for="(l,i) in liveData" :key="i" v-show="i<4">
                <div class="pic">
                    <img :src='l.liveimg' alt="">
                </div>
                <div class="live">
                    <span class="point"></span>
                    <span class="text">直播中</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            liveData: ''
        }
    },
    created() {
        this.getLive()
    },
    methods: {
        getLive(){
            this.axios.get('https://music.taihe.com/v1/musicshow/livelist?sign=3b75d04eedd3c4446c2c252ec3e7fdee&appid=16073360&timestamp=1613787724').then((res) => {
                this.liveData = res.data.data.result
            })
        }
    },
}
</script>

<style scoped>
    .liveBox{
        width: 80vw;
        margin: 0 auto;
        padding-bottom: 50px;
    }
    .title{
        display: flex;
        align-items: center;
        padding: 20px 0;
    }
    .title h1{
        font-weight: normal;
    }
    .title p{
        color: #909399;
        margin-left: 20px;
    }
    .infoBox{
        display: flex;
        justify-content: space-between;
    }
    .info{
        width: 24%;
        position: relative;
        overflow: hidden;
    }
    .info:hover img{
        transform: scale(1.05);
    }
    .info .pic img{
        width: 100%;
        height: 180px;
        transition: all .6s;
    }
    .info .live{
        width: 66px;
        height: 24px;
        border-radius: 20px;
        background: rgba(0,0,0,.4);
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 12px;
        left: 15px;
    }
    .info .live .point{
        display: inline-block;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background-color: red;
        margin-right: 6px;
    }
    .info .live .text{
        color: #fff;
        font-size: 12px;
    }
</style>